home *** CD-ROM | disk | FTP | other *** search
/ Developer CD Series 1994 November: Tool Chest / Dev.CD Nov 94.toast / Sample Code / Snippets / Networking / ADSP Chat / READ ME - ADSP Chat < prev   
Encoding:
Text File  |  1994-09-06  |  2.2 KB  |  27 lines  |  [TEXT/ttxt]

  1. *******************************************************************
  2. ADSP Chat 1.0
  3. 9/6/94
  4.  
  5. ADSP Chat is a sample application demonstrating the use of the AppleTalk Data
  6. Stream Protocol (ADSP).
  7.  
  8. Compilation Environment:
  9.     MPW 3.3.1 with the 68K Interfaces
  10.  
  11. Brought to you by the Apple Developer Support Group
  12. Written by Pete Helme, Scott Kuechle
  13. Questions/Comments should be sent to:
  14. AppleLink: DEVSUPPORT
  15.  
  16. Copyright © 1992-94, Apple Computer Inc. All Rights Reserved
  17. *******************************************************************
  18.  
  19. SUMMARY
  20.  
  21. This sample code demonstrates how to use the AppleTalk Data Stream Protocol (ADSP) to exchange data between two network processes. The code makes use of the ADSP Attention channel mechanism to send the clock time of the source machine to the target machine. Similarly, the ADSP dspRead and dspWrite calls are used to send messages back and forth from the source to the target. Most calls are made asynchronously using completion routines. The parameter block for a given call is taken from an OS Queue of parameter blocks that the application builds. This technique is described in more detail in Develop magazine Issue #13 "Asynchronous Routines on the Macintosh" by Jim Luther.
  22.  
  23. INSTRUCTIONS
  24.  
  25. Launch the application on two different machines on the network. The application registers itself with the Name Binding Protocol (nbp) once it is launched. It uses the Network Identity (found in the Sharing Setup Control Panel) for the nbp entity name object field and “moof” as the type field.
  26.  
  27. Use the “Zone”, “Type” and “Object” popup menus to identify and select other machines that are running the application. Once a target machine has been selected, press the “Connect” button and an ADSP connection will be established between the two machines. You can send text to the target machine by typing a message and then pressing the <enter> key. The target machine can also send text to the originating machine in the same manner. If this happens the text will show up in the “Incoming message” box. Additionally, the clock time of the target machine is displayed in the “Time from remote Mac” box. The clock time is sent across the connection using the attention mechanism. To close the connection, simply press the <disconnect> button on either machine.